const mongoose = require('mongoose');
const express = require('express');
const path = require('path');
const app = express();
const bodyParser = require('body-parser');
const todo = require('./router/todo');

mongoose.connect('mongodb://jal:666666@localhost:27017/todo', {useNewUrlParser: true, useUnifiedTopology: true});

app.use(express.static(path.join(__dirname, 'public')))
app.use(bodyParser.json({ extended: false }));

app.use('/todo', todo);


app.listen(80);
console.log('服务器启动成功');

